package itheima;
public class Student {
    //私有成员变量;
    private String name;
    private int age;
    public Student() {
    }
    //有参构造
    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        this.age = age;
    }
    //手动封装
    public void show() {
        System.out.println(this.name + "," + age);
    }
}
class StudentTest {
    public static void main(String[] args) {
        Student s1 = new Student();
        s1.setName("张三");
        s1.setAge(23);
        s1.show();
        Student s2 = new Student("张三", 23);
        s2.show();
    }
}